/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: AppCom.c
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: AppCom
*
*******************************************************************************/

/** HEADER FILES **/
#include "AppCom.h"


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/


/** LOCAL DATA DECLARATION **/


/** GLOBAL DATA DECLARATION **/


/** LOCAL FUNCTION DECLARATION **/


/** GLOBAL FUNCTION DECLARATION **/
void AppCom_GetVersionInfo(
    Std_VersionInfoType* versionInfo
);

void AppCom_GetSignal_Other_Can1_SignalC(
    uint8* data
);

void AppCom_MainFunction(
    void
);

/** LOCAL DATA **/
static uint16 testValue_YT_Can1_SignalA = 0x00;
static uint16 testValue_YT_Can1_SignalB = 0x00;
static uint16 testValue_Other_Can1_SignalA = 0x00;


/** GLOBAL DATA **/


/** LOCAL FUNCTION **/


/** GLOBAL FUNCTION **/

/*******************************************************************************
* -Name            AppCom_GetVersionInfo
* -Brief           Returns the version information of this module 
* -Details         None
* -Param[out]      versioninfo: Pointer to the version information of this module
* -Return          None          
*******************************************************************************/
void AppCom_GetVersionInfo(
    Std_VersionInfoType* versionInfo
)
{
    versionInfo->vendorID = (uint16)YSAR_VENDOR_ID;
    versionInfo->moduleID = (uint8)APPCOM_MODULE_ID;
    versionInfo->sw_major_version = (uint8)APPCOM_SW_MAJOR_VERSION;
    versionInfo->sw_minor_version = (uint8)APPCOM_SW_MINOR_VERSION;
    versionInfo->sw_patch_version = (uint8)APPCOM_SW_PATCH_VERSION;
}


/*******************************************************************************
* -Name            AppCom_GetSignal_Other_Can1_SignalC
* -Brief           
* -Details         None
* -Return          None          
*******************************************************************************/
void AppCom_GetSignal_Other_Can1_SignalC(
    uint8* data
)
{
    Com_ReceiveSignal(AppComConf_ComRxSignalCfg_Signal_Other_Can1_SignalC_Motorola, (void*)data);
}



/*******************************************************************************
* -Name            AppCom_MainFunction
* -Brief           
* -Details         None
* -Return          None          
*******************************************************************************/
void AppCom_MainFunction(
    void
)
{
    Com_SendSignal(AppComConf_ComTxSignalCfg_Signal_YT_Can1_SignalA_Motorola, (void*)&testValue_YT_Can1_SignalA);
    if(testValue_YT_Can1_SignalA < 1024)
    {
        testValue_YT_Can1_SignalA++;
    }
    else
    {
        testValue_YT_Can1_SignalA = 0;
    }

    Com_ReceiveSignal(AppComConf_ComRxSignalCfg_Signal_Other_Can1_SignalA_Motorola, (void*)&testValue_Other_Can1_SignalA);
    Com_SendSignal(AppComConf_ComTxSignalCfg_Signal_YT_Can1_SignalB_Intel, (void*)&testValue_Other_Can1_SignalA);
}




